/*
 * @brief : 锁的抽象接口
 * @date :  2022-02-xx
 * @version : v1.0.0
 * @copyright(c) 2020 : OptoMedic company Co.,Ltd. All rights reserved
 * @Change Logs:   
 * @date         author         notes:  
 * 
 */
#ifndef __LOCKER_H_
#define __LOCKER_H_

struct _locker;
typedef struct _locker locker_t;

typedef int (*lock_func)(locker_t *lk);
typedef int (*unlock_func)(locker_t *lk);
typedef int (*destroy_fuc)(locker_t *lk);

struct _locker {
    lock_func lock;
    unlock_func unlock;
    destroy_fuc destroy;
    void *private_data;
};

int locker_lock(locker_t *lk);
int locker_unlock(locker_t *lk);
int locker_destroy(locker_t *lk);

#endif /* __LOCKER_H_ */